using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       GWServerInfo_FeedbackSender.cs
*@brief      send message GWServerInfo_Feedback
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/18
*/

//send message GWServerInfo_Feedback
public class msgGWServerInfo_Feedback : IImplMessageType
{
    public const int MessageId = (int)GatewayServerTypes.MessageType.GWServerInfo_Feedback;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
    public gatewayserver.ServerInfoFeedback MsgContent = new gatewayserver.ServerInfoFeedback();

    /// <summary>
    /// constructor
    /// </summary>
    /// <param name="op"></param>
    /// <param name="session_id"></param>
    /// <param name="server_type"></param>
    /// <param name="ip"></param>
    /// <param name="port"></param>
    /// <param name="world_group"></param>
    /// <param name="world_id"></param>
	public msgGWServerInfo_Feedback(Int32 session_id, global.eServerType server_type, List<gatewayserver.ServerInfoFeedback.ServerDtail>  details)
	{
        SessionId = session_id;
        MsgContent.InfoList.AddRange(details);
        MsgContent.ServerType = server_type;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of GWServerInfo_Feedback</param>
    public static void ProcessMessage(msgGWServerInfo_Feedback msg)
    {
        //TODO
		msgGatewayServer mainMsg = new msgGatewayServer(msg.SessionId, msgGWServerInfo_Feedback.MessageId, 
			                                            ProtoNet<gatewayserver.ServerInfoFeedback>.IntoBytes(msg.MsgContent));
		
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
